package club.caihappy.config;

import club.caihappy.pojo.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.type.filter.TypeFilter;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/**
 * Created by DELL on 2021/10/4
 **/
@Configuration
@ComponentScan(value = "club.caihappy",excludeFilters = {
//        @ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class, Service.class}),
        @ComponentScan.Filter(type = FilterType.CUSTOM,classes = {MyTypeFilter.class})
},useDefaultFilters = false)
//@ComponentScan("club.caihappy")
public class MainConfig {
    //类型是返回值的类型，id是方法名作为id
    @Bean("person")
    public Person person1(){
        return new Person("李四",20);
    }
}
